\(\int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx\) [845]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 22 \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=-\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\text {arccosh}(x) \]

[Out]

arccosh(x)-(-1+x)^(1/2)*(1+x)^(1/2)/x

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {99, 54} \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=\text {arccosh}(x)-\frac {\sqrt {x-1} \sqrt {x+1}}{x} \]

[In]

Int[(Sqrt[-1 + x]*Sqrt[1 + x])/x^2,x]

[Out]

-((Sqrt[-1 + x]*Sqrt[1 + x])/x) + ArcCosh[x]

Rule 54

Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[ArcCosh[b*(x/a)]/b, x] /; FreeQ[{a,
 b, c, d}, x] && EqQ[a + c, 0] && EqQ[b - d, 0] && GtQ[a, 0]

Rule 99

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(a + b*
x)^(m + 1)*(c + d*x)^n*((e + f*x)^p/(b*(m + 1))), x] - Dist[1/(b*(m + 1)), Int[(a + b*x)^(m + 1)*(c + d*x)^(n
- 1)*(e + f*x)^(p - 1)*Simp[d*e*n + c*f*p + d*f*(n + p)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && LtQ[m
, -1] && GtQ[n, 0] && GtQ[p, 0] && (IntegersQ[2*m, 2*n, 2*p] || IntegersQ[m, n + p] || IntegersQ[p, m + n])

Rubi steps \begin{align*} \text {integral}& = -\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx \\ & = -\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+\cosh ^{-1}(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.64 \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=-\frac {\sqrt {-1+x} \sqrt {1+x}}{x}+2 \text {arctanh}\left (\sqrt {\frac {-1+x}{1+x}}\right ) \]

[In]

Integrate[(Sqrt[-1 + x]*Sqrt[1 + x])/x^2,x]

[Out]

-((Sqrt[-1 + x]*Sqrt[1 + x])/x) + 2*ArcTanh[Sqrt[(-1 + x)/(1 + x)]]

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(43\) vs. \(2(18)=36\).

Time = 0.61 (sec) , antiderivative size = 44, normalized size of antiderivative = 2.00

method result size
default \(\frac {\sqrt {-1+x}\, \sqrt {1+x}\, \left (\ln \left (x +\sqrt {x^{2}-1}\right ) x -\sqrt {x^{2}-1}\right )}{x \sqrt {x^{2}-1}}\) \(44\)
risch \(-\frac {\sqrt {-1+x}\, \sqrt {1+x}}{x}+\frac {\ln \left (x +\sqrt {x^{2}-1}\right ) \sqrt {\left (-1+x \right ) \left (1+x \right )}}{\sqrt {-1+x}\, \sqrt {1+x}}\) \(47\)

[In]

int((-1+x)^(1/2)*(1+x)^(1/2)/x^2,x,method=_RETURNVERBOSE)

[Out]

(-1+x)^(1/2)*(1+x)^(1/2)*(ln(x+(x^2-1)^(1/2))*x-(x^2-1)^(1/2))/x/(x^2-1)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.64 \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=-\frac {x \log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) + \sqrt {x + 1} \sqrt {x - 1} + x}{x} \]

[In]

integrate((-1+x)^(1/2)*(1+x)^(1/2)/x^2,x, algorithm="fricas")

[Out]

-(x*log(sqrt(x + 1)*sqrt(x - 1) - x) + sqrt(x + 1)*sqrt(x - 1) + x)/x

Sympy [F]

\[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=\int \frac {\sqrt {x - 1} \sqrt {x + 1}}{x^{2}}\, dx \]

[In]

integrate((-1+x)**(1/2)*(1+x)**(1/2)/x**2,x)

[Out]

Integral(sqrt(x - 1)*sqrt(x + 1)/x**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.23 \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=-\frac {\sqrt {x^{2} - 1}}{x} + \log \left (2 \, x + 2 \, \sqrt {x^{2} - 1}\right ) \]

[In]

integrate((-1+x)^(1/2)*(1+x)^(1/2)/x^2,x, algorithm="maxima")

[Out]

-sqrt(x^2 - 1)/x + log(2*x + 2*sqrt(x^2 - 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 40 vs. \(2 (18) = 36\).

Time = 0.29 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.82 \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=-\frac {8}{{\left (\sqrt {x + 1} - \sqrt {x - 1}\right )}^{4} + 4} - \frac {1}{2} \, \log \left ({\left (\sqrt {x + 1} - \sqrt {x - 1}\right )}^{4}\right ) \]

[In]

integrate((-1+x)^(1/2)*(1+x)^(1/2)/x^2,x, algorithm="giac")

[Out]

-8/((sqrt(x + 1) - sqrt(x - 1))^4 + 4) - 1/2*log((sqrt(x + 1) - sqrt(x - 1))^4)

Mupad [B] (verification not implemented)

Time = 2.10 (sec) , antiderivative size = 109, normalized size of antiderivative = 4.95 \[ \int \frac {\sqrt {-1+x} \sqrt {1+x}}{x^2} \, dx=4\,\mathrm {atanh}\left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )-\frac {\sqrt {x-1}-\mathrm {i}}{4\,\left (\sqrt {x+1}-1\right )}-\frac {\frac {5\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^2}{4\,{\left (\sqrt {x+1}-1\right )}^2}+\frac {1}{4}}{\frac {{\left (\sqrt {x-1}-\mathrm {i}\right )}^3}{{\left (\sqrt {x+1}-1\right )}^3}+\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}} \]

[In]

int(((x - 1)^(1/2)*(x + 1)^(1/2))/x^2,x)

[Out]

4*atanh(((x - 1)^(1/2) - 1i)/((x + 1)^(1/2) - 1)) - ((x - 1)^(1/2) - 1i)/(4*((x + 1)^(1/2) - 1)) - ((5*((x - 1
)^(1/2) - 1i)^2)/(4*((x + 1)^(1/2) - 1)^2) + 1/4)/(((x - 1)^(1/2) - 1i)^3/((x + 1)^(1/2) - 1)^3 + ((x - 1)^(1/
2) - 1i)/((x + 1)^(1/2) - 1))